/*
 * @Author: HeAo
 * @Date: 2021-10-25 20:48:37
 * @LastEditTime: 2021-10-26 09:28:05
 * @LastEditors: HeAo
 * @Description: 
 * @FilePath: \ej-customer\src\store\category\category.js
 * 别乱动！
 */
import { post, get } from '@/http/axios'
export default {
  namespaced: true,
  state () {
    return {
      categories: []
    }
  },
  mutations: {
    SET_CATEGORIES (state, payload) {
      state.categories = payload
    }
  },
  actions: {
    async findAllCategories ({ commit }) {
      let res = await get('/productCategory/pageQuery', {
        page: 1,
        pageSize: 100
      })
      commit('SET_CATEGORIES', res.data.data.list)
    }
  }
}